package com.imooc.controller;

import com.imooc.vo.EnRespStatus;
import com.imooc.vo.StoreReqVO;
import com.imooc.vo.StoreRspVO;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping("/store")
public class StoreRest {
    
    @PostMapping("/create")
    public StoreRspVO create(@Valid StoreReqVO reqVO, BindingResult result){
        StoreRspVO rspVO = new StoreRspVO();
        
        System.out.println("注册成功："+String.valueOf(reqVO.toString()));
        
        rspVO.setId(String.valueOf(System.currentTimeMillis()));
        rspVO.setEnRespStatus(EnRespStatus.SUCCESS);
        
        return rspVO;
    }
}